; ORIGINAL: 3dt2.1/examples/shade.scm
; $Id: shade.scm,v 1.5 1997/05/05 22:01:44 jread Exp $
;- shade.scm ------------------------------------------------------
; Render with new background, color and light sources
;------------------------------------------------------------------
;; Set the view for maximum effect
(view:set (position 100 100 100) (position 0 0 0) (gvector 0 0 1))

;; Create a plain yellow background
(define b (background "plain"))
(background:set-prop b "color" (color:rgb 1 1 0))
(render:set-background b)

;; Create a red brick sphere
(define sph (solid:sphere (position 0 0 0) 40))
(define m1 (material))
(material:set-color-type m1 "wrapped brick")
(material:set-color-prop m1 "brick color" (color:rgb 1 0 0))
(material:set-color-prop m1 "scale" .1)
(entity:set-material sph m1)
(define t1 (texture-space "spherical"))
(entity:set-texture-space sph t1)

;; Create a plain green cone
(define cone (solid:cone (position 0 0 35) (position 0 0 70) 20 0))
(define m2 (material))
(material:set-color-type m2 "plain")
(material:set-color-prop m2 "color" (color:rgb 0 1 0))
(entity:set-material cone m2)

;; Create a plain blue cylinder
(define cyl (solid:cylinder (position 30 0 0) (position 60 0 0) 20))
(define m3 (material))
(material:set-color-type m3 "plain")
(material:set-color-prop m3 "color" (color:rgb 0 0 1))
(entity:set-material cyl m3)

;; Create a light
(define l1 (light "point"))
(light:set-prop l1 "location" (gvector 80 30 100))
(light:set #t l1)

(render)
